const express = require("express")
const ProductController = require("../../controllers/admin/ProductController")
const ProductRouter = express.Router()
//图片上传
const multer = require("multer")
const upload = multer({ dest: 'public/productuploads/' })

ProductRouter.post("/adminapi/product/add", upload.single('file'), ProductController.add)
// ProductRouter.post("/adminapi/user/login", UserController.login)
ProductRouter.post("/adminapi/product/list", upload.single('file'), ProductController.updateList)
ProductRouter.get("/adminapi/product/list", ProductController.getList)
ProductRouter.get("/adminapi/product/list/:id", ProductController.getList)
// ProductRouter.put("/adminapi/user/list/:id", UserController.putList)
ProductRouter.delete("/adminapi/product/list/:id", ProductController.delList)
module.exports = ProductRouter